package com.atstudy.obj;

/**
 * @version v1.0
 * @description:
 * @author: admin
 * @date: 2022/12/21 9:34
 * @copyright: 博为峰
 */
public class ObjectDemo {
    public static void main(String[] args) {
        Student stu01 = new Student("张三", 20);
        Student stu02 = new Student("张三", 20);
//        System.out.println(stu01 == stu02); //false
//        System.out.println(stu01.equals(stu02)); //false
        /*
          public boolean equals(Object obj) {
             return (this == obj);
          }
        */

//        System.out.println(stu01);//com.com.atstudy.obj.Student@5594a1b5
//        System.out.println(IntegerDemo.toHexString(stu01.hashCode()));//5594a1b5
//        System.out.println(stu01.hashCode());//1435804085
//        System.out.println(stu02.hashCode());

//        System.out.println(stu01.toString());

//        System.out.println(stu01.toString());
//        System.out.println(stu02.toString());
        System.out.println(stu01 == stu02);
    }
}
